package com.yjd.pub.fundservice.service;

import com.yjd.comm.base.dao.IBaseDao;
import com.yjd.comm.base.service.impl.BaseServiceImpl;
import com.yjd.comm.fundservice.model.FundCalbackLogsModel;
import com.yjd.comm.fundservice.service.IFundCalbackLogsService;
import com.yjd.pub.fundservice.dao.IFundCalbackLogsDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * <b>description</b>：资金方回调日志表业务实现<br>
 * <b>time</b>：2018-01-31 16:12:11 <br>
 * <b>author</b>：  carl
 */
@Service("fundCalbackLogsService")
public class FundCalbackLogsServiceImpl extends BaseServiceImpl implements IFundCalbackLogsService {

	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public FundCalbackLogsModel insert(FundCalbackLogsModel model) throws Exception {
		return this.fundCalbackLogsDao.insertModel(model, true);
	}

	/**
	 * 更新
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(FundCalbackLogsModel model) throws Exception {
		return this.fundCalbackLogsDao.updateModel(model, true);
	}

	/**
	 * 根据id删除
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(long id) throws Exception {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("id", id);
		return this.fundCalbackLogsDao.deleteModel(paramMap, true);
	}

	@Resource
	private IFundCalbackLogsDao fundCalbackLogsDao;

	@Override
	public IBaseDao getBaseDao() {
		return this.fundCalbackLogsDao;
	}

}
